cmake_minimum_required(VERSION 2.6)

project(qfit)

set(QFIT_VERSION_MAJOR 0)
set(QFIT_VERSION_MINOR 3)
set(QFIT_VERSION_PATCH 0)

SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -g")

option(WITH_GUI "Build the Qt interface" ON)
option(WITH_QWT "Build GUI with the plot Widget" ON)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules")
find_package(Qt4)
if(WITH_GUI AND WITH_QWT)
	find_package(Qwt6 REQUIRED)
endif(WITH_GUI AND WITH_QWT)

add_subdirectory(src)


# CPack vars
set(CPACK_PACKAGE_VERSION_MAJOR ${QFIT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${QFIT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${QFIT_VERSION_PATCH})

set(CPACK_PACKAGE_VENDOR "qfit development team")
set(CPACK_GENERATOR STGZ TBZ2)
set(CPACK_SOURCE_GENERATOR TBZ2)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "qfit-${QFIT_VERSION_MAJOR}.${QFIT_VERSION_MINOR}.${QFIT_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME "qfit-${QFIT_VERSION_MAJOR}.${QFIT_VERSION_MINOR}.${QFIT_VERSION_PATCH}-i686-linux")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README)

set(CPACK_SOURCE_IGNORE_FILES
	".git*"
	".kdev4"
	"qfit.kdev4"
	"${CMAKE_CURRENT_SOURCE_DIR}/build")

include(CPack)
